{%include file="index.header.tpl.php"%}
{%include file="index.left.tpl.php"%}
<!--主要内容开始-->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <!-- Main content -->
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <form action="" method="post">
                        <div class="box-header with-border">
                            <span class="fa fa-edit" style="float:left; font-size:18px; margin-top:2px; color:#3c8dbc;"></span>
                            <h3 class="box-title">布置作业</h3>
                        </div>
                        <div class="box-body">

                            <div class="form-group">
                                <label class="col-md-4 control-label text-right">
                                    班级：
                                </label>
                                <div class="input-group col-md-6">
                                    <p>
                                        {%$data.class_name%}
                                    </p>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-md-4 control-label text-right">
                                    学科名称：
                                </label>
                                <div class="input-group col-md-4">
                                    <select class="form-control" name="subject_id">
                                        <option  >请选择学科</option>
                                        {%foreach from=$subject_lists key=key item=value%}
                                        <option value="{%$value.subject_id%}" {%if $value.subject_id eq $data.subject_id %}selected{%/if%}>{%$value.subject_name%}</option>
                                        {%/foreach%}
                                    </select>
                                </div>
                            </div>
                            <!-- 时间日历标签 -->
                            <div class="form-group">
                                <label for="inputPassword3" class="col-md-4 control-label text-right"  "> 日期： </label>
                                <div class="input-group col-md-4" style="float:left;">
                                    <input id="from" class="form-control" value="{%$data.homework_date%}" name="homework_date" type="text">
                                    <div class="input-group-addon" style="padding:6px 7px;">
                                        <i class="fa fa-calendar"></i>
                                    </div>
                                </div>

                            </div>
                            <div style="clear: both; height: 14px;"></div>
                            <div class="form-group">
                                <label class="col-md-4 control-label text-right">
                                    作业内容：
                                </label>
                                <div class="input-group col-md-4">
                                    <textarea class="form-control" rows="3" name="homework_content">{%$data.homework_content%}</textarea>
                                </div>
                            </div>

                        </div>
                        <div class="box-footer text-center">
                            <input type="hidden" name="staff_id" value="{%$staff_id%}">
                            <button type="submit" class="btn btn-primary"> 保 存</button>
                        </div>
                    </form>
                </div>
                <!-- /.col -->
            </div>
            <!-- /.row -->
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
{%include file="index.footer.tpl.php"%}
<script>
    /*日历编辑*/
    $(function() {
        $( "#from" ).datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            changeYear: true,
            numberOfMonths:1,
            onClose: function( selectedDate ) {
                $( "#to" ).datepicker( "option", "minDate", selectedDate );
            }
        });
        $( "#to" ).datepicker({
            defaultDate: "+1w",
            changeMonth: true,
            changeYear: true,
            numberOfMonths:1,
            onClose: function( selectedDate ) {
                $( "#from" ).datepicker( "option", "maxDate", selectedDate );
            }
        });
    });
</script>